package cn.stylefeng.guns.sys.core.util.common;


public enum SysErrorCode implements IErrorCode {
	//操作成功
	LOGGER_ERROR(400, "用户名或密码错误"),
	LOGGER_NOTREG(400, "用户未注册"),
	LOGGER_NOPHONE(400, "用户未绑定手机号"),
	RETURN_SUCCESS(10001, "操作成功"),
	BIND_SUCCESS(10010, "微信绑定成功"),
	
	// 需要支付
	UNPAY_STATE(11000, "支付费用"),
	
	// 异常码定义
	ACCPUNT_ERROR(10006, "该手机号已存在"),
	PHONE_NOTEXITS(10009, "该手机号不存在"),
	FORMAT_ERROR(10007, "该手机号格式错误"),
	LOGINPWD_ERROR(10005, "密码错误"),
	NOUSER_ERROR(10004, "用户名不存在"),
	SMSCODE_ERROR(10003, "短信验证码错误"),
	UPLOAD_ERROR(10002,"图片上传失败"),
	FILE_ERROR(10002,"文件格式错误，上传失败"),
	
	PARAMETER_ERROR(10002,"参数错误！"),
	YUANBAO_ERROR(10002,"元宝不足"),
	REDBAG_NUM_ERROR(10002,"红包金额和数量不对等"),
	Auth_ERROR(10002,"请进行商户认证"),
	
	
	
	
	CATEGORY_ERROR(10002,"分类不能为空！"),
	ADDRESS_ERROR(10002,"区域不能为空！"),
	MARKET_ERROR(10002,"商圈不能为空！"),
	CARDAPPLYOFF_ERROR(10002,"管理员关闭了发帖功能！"),
	

	RETURN_ERROR(10002, "操作失败"),
	SYSTEM_ERROR(10002, "系统异常"),
	PARAM_ERROR(10002, "传入参数为空"),
	STATEPARAM_ERROR(10002,"审核状态值为空"),
	TOKEN_ANALYSIS_ERROR(10004, "token解析错误"),
	BUSINESS_ERROR(10002, "业务异常"),
	PROXY_CONNECT_ERROR(10002, "远程接口连接异常"),
	SYSTEM_BUSY(10002, "系统繁忙，请稍后再试"),
	LOGINCODE_ERROR(10003, "用户不存在"),
	CODEORPWD_ERROR(10006, "用户账号或者密码错误"),
	STOP_ERROR(10005, "该用户已被停用,请联系管理员"),
	TOKEN_ERROR(10004, "传入token为空"),
	OPENID_ERROR(10002, "openId不能为空"),
	ONLY_SINGLE_KILL(10002, "秒杀商品不可重复购买"),
	TOKEN_FORMAT_ERROR(10002, "token解析有错"),
	PROXY_RETURN_ERROR(10002, "远程接口返回异常"),
	GET_OPENID_ERROR(10002, "微信获取openId失败"),
	ACCESSTOKEN_ERROR(10002, "access_token获取失败"),
	TOKEN_EXPIRE(10004, "用户token过期"),
	ORDER_EXIST(10005, "订单不存在"),
	ORDER_LT_ZEOR(100051, "退款金额大于支付总价，请核对后再退款"),
	ORDER_NOT_IN_REFUND(10006, "订单属于申请退款状态，不能退款"),
	ORDER_NOT_IN_PAY(10007, "商户支付订单不存在"),
	ORDER_UPDATESTATUS_ERROR(10002, "订单更新状态失败"),
	PRODUCT_OUTSALE(10002, "商品已下架"),
	PRODUCT_STOCK_EMPTY(10002, "商品库存不足"),
	TOKEN_INVALID(401,"token失效"),
	TOKEN_NULL(2001,"token为空"),
	TOKEN_EXCEPTION(2002,"token获取异常"),
	
	//参数校验返回失败
	VALIDATE_ERROR_ADVICE(500,""),
	ADDRESS_ISNULL(10002, "地址不能为空"),
	USER_ISNULL(10002, "用户id不能为空"),
	SHOPTYPE_ISNULL(10002, "渠道来源不能为空"),
	SHOPTYPE_NOT_IN_CHANNEL(10002, "该渠道商不存在"),
	CODE_ERROR(10002, "传入非法的code"),
	CONTENT_INNULL(10002,"输入内容不能为空")
	;

	
	private Integer code;

	private String desc;

	SysErrorCode(Integer code, String desc) {
		this.setCode(code);
		this.setDesc(desc);
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	@Override
	public String toString() {
		return "[" + this.code + "]" + this.desc;
	}
}
